package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.ysd.entity.Company;
import com.ysd.uitl.DBManager;
import com.ysd.uitl.Result;

public class companyDaoImpl {
	public Company getCompany() {
		Connection conn = DBManager.getConnection();
		Statement st = null;
		ResultSet rs = null;
		Company company=null;
		try {
			st=conn.createStatement();
			rs=st.executeQuery("select * from company");
			while(rs.next()) {
				String companyName=rs.getString("companyName");
				String webSite=rs.getString("webSite");
				String logo=rs.getString("logo");
				String companyProfile=rs.getString("companyProfile");
				String companyPhone=rs.getString("companyPhone");
				String companyEmail=rs.getString("companyEmail");
				String companyHome=rs.getString("companyHome");
				String culture=rs.getString("culture");
				company=new Company(companyName,webSite,logo,companyProfile,companyPhone,companyEmail,companyHome,culture);
				
				
				}
			return company;
		} catch (SQLException e) {
			e.printStackTrace();
			return null;
		} finally {
			DBManager.closeAll(conn, st, rs);
		}

	}
}
